package com.markus.code.exam.tonghuashun;

/**
 * Author:markusZhang
 * Date:Create in 2020/9/5 11:39
 * todo:
 */
public class C {
    public static void main(String[] args) {
        int []arr = {1,0,3,4,0,5};
        for (int i=0;i<arr.length-1;i++){
            for (int j=0;j<arr.length-i-1;j++){
                if (arr[j] == 0){
                    swap(arr,j,j+1);
                }
            }
        }
        for (int i : arr) {
            System.out.print(i+" ");
        }
    }
    private static void swap(int []arr,int i,int j){
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }
}
